package data;

import com.EntityName;
import com.google.appengine.api.datastore.Entity;

public class MessageFolio extends AbstractData{
	private long id = -1;
	private long hotelId;
	private String message;
	private String thxmessage;
	private String pic;
	
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public long getHotelId() {
		return hotelId;
	}

	public void setHotelId(long hotelId) {
		this.hotelId = hotelId;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getThxmessage() {
		return thxmessage;
	}

	public void setThxmessage(String thxmessage) {
		this.thxmessage = thxmessage;
	}

	public String getPic() {
		return pic;
	}

	public void setPic(String pic) {
		this.pic = pic;
	}

	@Override
	public Entity getEntity() {
		Entity item;
		if(this.key == null)
			item = new Entity(EntityName.MessageFolio);
		else
			item = new Entity(this.key);

		item.setProperty("hotelId", this.hotelId);
		item.setProperty("message", this.message);
		item.setProperty("thxmessage", this.thxmessage);
		item.setProperty("pic", this.pic);
		return item;
	}

	@Override
	public void setEntity(Entity entity) {
		this.id = entity.getKey().getId();
		this.hotelId = (Long) entity.getProperty("hotelId");
		this.message = (String) entity.getProperty("message");
		this.thxmessage = (String) entity.getProperty("thxmessage");
		this.pic = (String) entity.getProperty("pic");
		this.key = entity.getKey();
	}

	public void LoadData()
	{
		if(this.id > -1)
		{
			Entity entity = LoadData(EntityName.MessageFolio,this.id);
			setEntity(entity);
		}
	}

}
